'''
Descripttion: 
Author: White
Date: 2024-12-30 11:38:12
LastEditTime: 2024-12-30 14:26:30
'''
from db import db


class Equipment(db.Model):
    __tablename__ = 'tb_equipment'
    equipment_id = db.Column(db.String(255), primary_key=True)
    equipment_name = db.Column(db.String(255))
    price = db.Column(db.String(255))
    configuration = db.Column(db.String(255))
    supplier = db.Column(db.String(255))
    appearance_date = db.Column(db.String(255))
    laboratory_name = db.Column(db.String(255))

    def __init__(self, equipment_id, equipment_name, price, configuration, supplier, appearance_date, laboratory_name):
        self.equipment_id = equipment_id
        self.equipment_name = equipment_name
        self.price = price
        self.configuration = configuration
        self.supplier = supplier
        self.appearance_date = appearance_date
        self.laboratory_name = laboratory_name
    
    def get(self):
        return {
            "equipment_id": self.equipment_id,
            "equipment_name": self.equipment_name,
            "price": self.price,
            "configuration": self.configuration,
            "supplier": self.supplier,
            "appearance_date": self.appearance_date,
            "laboratory_name": self.laboratory_name

        }
        

    def __repr__(self):
        return f'<Equipment {self.equipment_name}>'